package com.cc.springboot_test.utils;

import org.apache.commons.lang3.builder.ToStringStyle;

import java.io.Serializable;

public class NotNullStyle extends ToStringStyle implements Serializable {
    private static final long serialVersionUID = -5092696992925241963L;

    // 设置打印格式
    public NotNullStyle() {
        super();
        this.setUseShortClassName(true);
        this.setUseIdentityHashCode(true);
    }

    // 对象NULL不输出

    @Override
    public void append(StringBuffer buffer, String fileName, Object value, Boolean fullDetail) {
        if (null != value) {
            super.append(buffer, fileName, value, fullDetail);
        }
    }
}
